<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title></title>
		<link href="css/index.css" rel="stylesheet" />
	</head>
	<body>
	
	<div class="wrapTicketHistory">
		<div class="headTitle">
		<img onclick="goback()" src="./img/leftArrow.jpg" />
		<p>开票历史</p>
       	</div>
		<div style="position: relative;">
		<ul> 
		<!-- 	<li @click="gotoDetiles(item.receipt_code)" v-for='item of historyArr'>
				<p class="pLeft">
					<span class="spanTitle">电子发票</span>
					<span class="spanTime">{{item.rec_time}}</span>
				</p>
				<span class="spanRightArrow"><img src="../../static/img/rightArrow.jpg" /></span>
				<p class="pRight">
					<span class="spanMoney">{{item.rec_amt}}元</span>
					<span class="spanType">{{item.status|statusType}}</span>
				</p>
			</li> -->
			<!--<li>
				<p class="pLeft">
					<span class="spanTitle">电子发票</span>
					<span class="spanTime">2016年7月10日 12:00</span>
					<span class="spanCardNum">卡号:6666666666</span>
				</p>
				<p class="pRight">
					<span class="spanMoney">100元</span>
					<span class="spanType">待开票</span>
				</p>
			</li> 
			<li>
				<p class="pLeft">
					<span class="spanTitle">电子发票</span>
					<span class="spanTime">2016年7月10日 12:00</span>
					<span class="spanCardNum">卡号:6666666666</span>
				</p>
				<p class="pRight">
					<span class="spanMoney">100元</span>
					<span class="spanType">待开票</span>
				</p>
			</li> -->
		</ul>
		
		
	
		
		
		</div>
	</div>
	
		<div class="noRecord">
		<img src="img/noRecord.jpg" />
		<span>暂无历史记录哟！</span>
		</div>
	

<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript" src="js/oldPublic.js" ></script>
<script src="js/code.js"></script>
<script src="js/security.js"></script>
<script>
	var detailJson = '';
	var login_name = sessionStorage.getItem('login_name');
	var telphone = sessionStorage.getItem('telphone');
	var orgcode = sessionStorage.getItem('orgcode');
		$.ajax({
				type:"post",
				url:sessionStorage.getItem('ipconfig'),
				data:JSON.stringify({data:encryptByDESModeEBC(JSON.stringify({"tag": "9105", 'login_name': login_name, 'telphone': telphone,'orgcode':orgcode }))}),
				contentType: "application/json;charset=utf-8",
				success:function(data){
					var str = '';
					if(data.result=='00'){
						if(!data.invoice_info){
							$('.noRecord').show();
							return;
						}
						detailJson =JSON.parse(data.invoice_info);
						var historyList =JSON.parse(data.invoice_info);
						console.log(historyList);
						for(var i=0;i<historyList.length;i++){
							str+='<li onclick="gotoDetial(this)">'+
									'<p class="pLeft">'+
										'<span class="spanTitle">'+historyList[i].name+'</span>'+
										'<span class="spanTime">'+historyList[i].apply_date+'</span>'+
										'<span class="spanCardNum">发票号:'+historyList[i].invoice_no+'</span>'+
									'</p>'+
									'<p class="pRight">'+
										'<span class="spanMoney">'+historyList[i].sum_amt+'元</span>'+
										'<span class="spanType"></span>'+
									'</p>'+
								'</li>'
						}
						$('ul').html(str);
					}else{
						showWarn(data.description);
					}
				}
			});
			function gotoDetial(a){
				var index = $(a).index();
				var detialItem = detailJson[index];
				detialItem = JSON.stringify(detialItem);
				window.location.href = './invoiceDetiles.html?detialItem='+detialItem;
			}
</script>

</body>
</html>


